home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 23 code / Documentary Synchronicity ƒ / Source ƒ / Support ƒ / Splash.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-10  |  1.0 KB  |  44 lines  |  [TEXT/KAHL]

  1. /* 4567890123456789012345678901234567890123456789012345678901234567 */
  2. /*
  3.  * File:              Splash.c
  4.  * Author:            Mark H. Linton
  5.  * Creation Date:     2/4/95
  6.  * Modification Date: 
  7.  * Description:       A collection of routines which may be used to 
  8.  *                    display and remove a "splash" screen during
  9.  *                    application start-up.
  10.  */
  11. #include <Dialogs.h>
  12. #include <Memory.h>
  13.  
  14. #include "Splash.h"
  15. #include "Toolbox.h"
  16.  
  17. static DialogPtr theSplashScreen = nil;
  18. static GrafPtr theCurrentPort = nil;
  19.  
  20. void Splash(short anID) {
  21.     if (theSplashScreen == nil) {
  22.         GetPort(&theCurrentPort);
  23.         theSplashScreen = GetNewDialog(anID, nil, kInFront);
  24. #if STRICT_WINDOWS
  25.         SetPortWindowPort(theSplashScreen);
  26. #else
  27.         SetPort(theSplashScreen);
  28. #endif
  29.         DrawDialog(theSplashScreen);
  30.     }
  31. }
  32.  
  33. void UnSplash(Boolean clean) {
  34.     long ignored;
  35.  
  36.     if (theSplashScreen != nil) {
  37.         DisposeDialog(theSplashScreen);
  38.         theSplashScreen = nil;
  39.         SetPort(theCurrentPort);
  40.     }
  41.     if (clean) {
  42.         (void)MaxMem(&ignored); /* Clean up the heap before we leave */
  43.     }
  44. }